Class Processes
	Private objWmi
	Private blnConnect

	Private Sub Class_Initialize()
		Set objWmi = New Wmi
		
		blnConnect = False
		objWmi.WmiPath = "\root\cimv2"
	End Sub
	
	Public Property Let Login(ByVal varValue)
		objWmi.Login = varValue
	End Property
	
	Public Property Let Password(ByVal varValue)
		objWmi.Password = varValue
	End Property
	
	Public Property Let IpAddress(ByVal varValue)
		objWmi.IpAddress = varValue
	End Property
	
	Public Sub Connect()
		objWmi.Connect()
		
		blnConnect = True
	End Sub
	
	Public Function CreateProcess(ByVal strCommandString)
		If Not blnConnect Then
			Err.Raise 5000, "Processes->CreateProcess", "Error Description"
		End If
		
		Set objProcess = objWmi.WmiService.Get("Win32_Process")
		
		If objProcess.Create(strCommandString, , , CreateProcess) <> 0 Then
			Err.Raise 5000, "Processes->CreateProcess", "Error Description - Creating remote process"
		End If
	End Function
	
	Public Sub TerminateProcess(ByVal strProcessName)
		If Not blnConnect Then
			Err.Raise 5000, "Processes->TerminateProcess", "Error Description"
		End If
		
		Set colProcesses = objWmi.WmiService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = '" & strProcessName & "'")
		
		For Each objProcess in colProcesses
			objProcess.Terminate()
		Next
	End Sub
End Class